from utils.tried_tree_utils import InfoTriedTree

from project_setting import KEYWORDS_DATA_PATH

global_dict = {}

text_parse_ignore = ['table_key']
table_parse_ignore = ['parsemode']

def get_keywordTredTree_instance():
    if 'keyword' not in global_dict:
        global_dict["keyword"] = InfoTriedTree(KEYWORDS_DATA_PATH)  # KEYWORDS_DATA_PATH就是对应的字典的路径

    return global_dict['keyword']

def get_textparse_keywordTredTree_instance():
    if 'text_parse_keyword' not in global_dict:
        global_dict["text_parse_keyword"] = InfoTriedTree(KEYWORDS_DATA_PATH,text_parse_ignore)  # KEYWORDS_DATA_PATH就是对应的字典的路径

    return global_dict['text_parse_keyword']

def get_tableparse_keywordTredTree_instance():
    if 'table_parse_keyword' not in global_dict:
        global_dict["table_parse_keyword"] = InfoTriedTree(KEYWORDS_DATA_PATH,table_parse_ignore)  # KEYWORDS_DATA_PATH就是对应的字典的路径

    return global_dict['table_parse_keyword']


if __name__ == '__main__':
    print(get_tableparse_keywordTredTree_instance().get_word_types("中标结果信息"))